// message.js

import { Message } from "element-ui";
let messageStatus = null;
export default class ShowMessage {
	success(options) {
		this.message("success", options);
	}

	warning(options) {
		this.message("warning", options);
	}

	info(options) {
		this.message("info", options);
	}

	error(options) {
		this.message("error", options);
	}

	message(type, options) {
		if (messageStatus) {
			messageStatus.close();
		}
		messageStatus = Message[type](options);
	}
}
